package com.example.invoicing.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class CommunalController {


    @RequestMapping(value = "/register")
    public String register(){
        return "register";
    }

    @RequestMapping(value = "/login")
    public String login(){
        return "login";
    }

    @RequestMapping(value = "/forgetPassword")
    public String forgetPassword(){
        return "forgetPassword";
    }


    @RequestMapping(value = "/admin")
    public String admin(HttpServletRequest request){
        try {
            HttpSession session = request.getSession(true);
            session.setAttribute("user_leve", "1");
        }catch (Exception e) {
            e.printStackTrace();
        }
        return "admin";
    }


    @RequestMapping(value = "/user")
    public String user(HttpServletRequest request){
        try {
            HttpSession session = request.getSession(true);
            session.setAttribute("user_leve", "2");
        }catch (Exception e) {
            e.printStackTrace();
        }
        return "user";
    }

    @RequestMapping(value = "/assistance")
    public String assistance(){
        return "assistance";
    }

    @RequestMapping(value = "/personalData")
    public String personalData(){
        return "personalData";
    }

    @RequestMapping(value = "/changePassword")
    public String changePassword(){
        return "changePassword";
    }

    @RequestMapping(value = "/addUsers")
    public String addUsers(){
        return "addUsers";
    }

    @RequestMapping(value = "/adminUpdateUsers")
    public String adminUpdateUsers(){
        return "adminUpdateUsers";
    }

    @RequestMapping(value = "/adminStrationManagement")
    public String adminStrationManagement(){
        return "adminStrationManagement";
    }

    @RequestMapping(value = "/supplierManagement")
    public String supplierManagement(){
        return "supplierManagement";
    }

    @RequestMapping(value = "/storeManagement")
    public String storeManagement(){
        return "storeManagement";
    }

    @RequestMapping(value = "/warehouseQueries")
    public String warehouseQueries(){
        return "warehouseQueries";
    }

    @RequestMapping(value = "/outboundQuery")
    public String outboundQuery(){
        return "outboundQuery";
    }

    @RequestMapping(value = "/inventoryManagement")
    public String inventoryManagement(){
        return "inventoryManagement";
    }

    @RequestMapping(value = "/salesManagement")
    public String salesManagement(){
        return "salesManagement";
    }

    @RequestMapping(value = "/statisticsStatements")
    public String statisticsStatements(){
        return "statisticsStatements";
    }

    @RequestMapping(value = "/addSupplier")
    public String addSupplier(){
        return "addSupplier";
    }

    @RequestMapping(value = "/addWarehouse")
    public String addWarehouse(){
        return "addWarehouse";
    }

    @RequestMapping(value = "/addStorage")
    public String addStorage(){
        return "addStorage";
    }

    @RequestMapping(value = "/addDelivery")
    public String addDelivery(){
        return "addDelivery";
    }

    @RequestMapping(value = "/addSales")
    public String addSales(){
        return "addSales";
    }

    @RequestMapping(value = "/diagram")
    public String diagram(){
        return "diagram";
    }

}
